package com.ljf.daily.costmanagement.infra.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.infra.repository.impl.BasisRepositoryImpl;
import com.ljf.common.utils.CollectionUtil;
import com.ljf.daily.costmanagement.domain.repository.DailyDatCostManagementDetailOperateRepository;
import com.ljf.daily.costmanagement.dto.query.DailyDatCostManagementDetailOperateQuery;
import com.ljf.daily.costmanagement.infra.mapper.DailyDatCostManagementDetailOperateMapper;
import com.ljf.daily.costmanagement.model.DailyDatCostManagementDetailOperate;
import com.ljf.daily.costmanagement.vo.DailyDatCostManagementDetailOperateVO;
import org.springframework.stereotype.Component;

/**
 * 费用管理明细操作  数据访问接口实现
 *
 * @author LJF
 * @since 2025-04-25
 */
@Component
public class DailyDatCostManagementDetailOperateRepositoryImpl extends BasisRepositoryImpl<DailyDatCostManagementDetailOperateMapper, DailyDatCostManagementDetailOperate, DailyDatCostManagementDetailOperateQuery, DailyDatCostManagementDetailOperateVO> implements DailyDatCostManagementDetailOperateRepository {

    @Override
    protected QueryWrapper<DailyDatCostManagementDetailOperate> fillWrapper(DailyDatCostManagementDetailOperateQuery query, boolean sort) throws ServiceException {
        QueryWrapper<DailyDatCostManagementDetailOperate> wrapper = super.fillWrapper(query, sort);
        if (CollectionUtil.isNotEmpty(query.getCodeList())) {
            wrapper.in(DailyDatCostManagementDetailOperate.COL_CODE, query.getCodeList());
        }
        return wrapper;
    }
}
